package com.chushouya.order.dto.admin.orderclothesproduct;

import com.general.framework.core.lang.Dates;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.math.BigDecimal;
import java.util.Date;

@Data
@ApiModel("订单旧衣商品详情")
public class OrderClothesProductDetailDTO {

    @ApiModelProperty("订单旧衣商品ID")
    private Long orderClothesProductId;

    @ApiModelProperty("订单ID")
    private Long orderId;

    @ApiModelProperty("地区编码")
    private String districtCode;

    @ApiModelProperty("地区名称")
    private String district;

    @ApiModelProperty("商品名称")
    private String productName;

    @ApiModelProperty("商品图片")
    private String productImage;

    @ApiModelProperty("价格")
    private BigDecimal productPrice;

    @ApiModelProperty("重量范围")
    private String weightRange;

    @ApiModelProperty("状态")
    private Integer status;

    @ApiModelProperty("状态描述")
    private String statusDesc;

    @ApiModelProperty("操作人")
    private String handleUser;

    @ApiModelProperty("删除标记")
    private Integer delFlag;

    @ApiModelProperty("创建时间")
    @JsonFormat(pattern = Dates.FMT_FULL_TIME)
    private Date createTime;

    @ApiModelProperty("更新时间")
    @JsonFormat(pattern = Dates.FMT_FULL_TIME)
    private Date updateTime;

    /**
     * 获取状态描述
     */
    public String getStatusDesc() {
        if (status == null) {
            return "未知";
        }
        switch (status) {
            case 0:
                return "禁用";
            case 1:
                return "启用";
            default:
                return "未知";
        }
    }
}
